﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:me="clr-namespace:ScrumBoard"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">

  <me:CellToTaskStateConverer x:Key="CellToTaskStateConverer" />
  
	<Style x:Key="TaskStateCellStyle" TargetType="sdk:DataGridCell">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
		<Setter Property="VerticalContentAlignment" Value="Stretch"/>
		<Setter Property="IsTabStop" Value="False"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="sdk:DataGridCell">
					<Grid x:Name="Root" Background="{TemplateBinding Background}">
						<Grid.ColumnDefinitions>
							<ColumnDefinition/>
							<ColumnDefinition Width="Auto"/>
						</Grid.ColumnDefinitions>
						<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						<Rectangle x:Name="RightGridLine" Grid.Column="1" VerticalAlignment="Stretch" Width="1"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="DataGridRowStyle1" TargetType="sdk:DataGridRow">
		<Setter Property="IsTabStop" Value="False"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="sdk:DataGridRow">
					<sdk:DataGridFrozenGrid x:Name="Root" VerticalAlignment="Top">
						<sdk:DataGridFrozenGrid.RowDefinitions>
							<RowDefinition />
							<RowDefinition Height="Auto"/>
						</sdk:DataGridFrozenGrid.RowDefinitions>
						<sdk:DataGridCellsPresenter x:Name="CellsPresenter" sdk:DataGridFrozenGrid.IsFrozen="True"/>
						<Rectangle x:Name="BottomGridLine" HorizontalAlignment="Stretch" Height="1" Grid.Row="1"/>
					</sdk:DataGridFrozenGrid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="VerticalAlignment" Value="Top"/>
	</Style>
	<Style x:Key="DataGridColumnHeaderStyle1" TargetType="sdk:DataGridColumnHeader">
		<Setter Property="Foreground" Value="#FF969481"/>
		<Setter Property="Background" Value="#4cffffff" />
		<Setter Property="HorizontalContentAlignment" Value="Left"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="FontFamily" Value="Segoe UI Light"/>
		<Setter Property="FontWeight" Value="Normal"/>
		<Setter Property="Padding" Value="10,0" />
		<Setter Property="Height" Value="50" />
		<Setter Property="FontSize" Value="24" />
		<Setter Property="IsTabStop" Value="False"/>
		<Setter Property="SeparatorBrush" Value="#15000000"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="sdk:DataGridColumnHeader">
					<Grid x:Name="Root" Background="{TemplateBinding Background}">
						<Grid.ColumnDefinitions>
							<ColumnDefinition/>
							<ColumnDefinition Width="Auto"/>
						</Grid.ColumnDefinitions>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Pressed"/>
							</VisualStateGroup>
							<VisualStateGroup x:Name="SortStates">
								<VisualState x:Name="Unsorted"/>
								<VisualState x:Name="SortAscending">
									<Storyboard>
										<DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon"/>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="SortDescending">
									<Storyboard>
										<DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon"/>
										<DoubleAnimation Duration="0" To="-.9" Storyboard.TargetProperty="(RenderTransform).ScaleY" Storyboard.TargetName="SortIcon"/>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>

							<ContentPresenter Content="{TemplateBinding Content}"  Margin="{TemplateBinding Padding}"
							 									HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>


						<Rectangle x:Name="VerticalSeparator" Grid.Column="1" Fill="{TemplateBinding SeparatorBrush}" Visibility="{TemplateBinding SeparatorVisibility}" VerticalAlignment="Stretch" Width="1"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="FontStyle" Value="Normal"/>
	</Style>
	
	<Style x:Key="DataGridStyle1" TargetType="sdk:DataGrid">
		<Setter Property="RowBackground" Value="{x:Null}"/>
		<Setter Property="AlternatingRowBackground" Value="{x:Null}"/>
		<Setter Property="Background" Value="{x:Null}"/>
		<Setter Property="HeadersVisibility" Value="Column"/>
		<Setter Property="GridLinesVisibility" Value="All" />
		<Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="SelectionMode" Value="Extended"/>
		<Setter Property="CanUserReorderColumns" Value="False"/>
		<Setter Property="CanUserResizeColumns" Value="True"/>
		<Setter Property="CanUserSortColumns" Value="False"/>
		<Setter Property="AutoGenerateColumns" Value="False"/>
		<Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected"/>
	  <Setter Property="RowStyle" Value="{StaticResource DataGridRowStyle1}" />
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="MinHeight" Value="250"  />
		<Setter Property="VerticalAlignment" Value="Top"  />
		<Setter Property="ColumnHeaderStyle" Value="{StaticResource DataGridColumnHeaderStyle1}" />
		<Setter Property="HorizontalGridLinesBrush" Value="#15000000"/>
		<Setter Property="IsTabStop" Value="True"/>
		<Setter Property="VerticalGridLinesBrush" Value="#15000000"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="sdk:DataGrid">
					<Grid>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="Disabled"/>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
					
							<Grid x:Name="Root" Background="{TemplateBinding Background}">

								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
									<RowDefinition/>
								</Grid.RowDefinitions>

								<sdk:DataGridColumnHeadersPresenter x:Name="ColumnHeadersPresenter"/>
								<sdk:DataGridRowsPresenter x:Name="RowsPresenter" Grid.Row="1" VerticalAlignment="Top"/>

								<ScrollBar x:Name="VerticalScrollbar"  Margin="18,-1,-18,-1" HorizontalAlignment="Right"
								 Orientation="Vertical" Grid.Row="1" Width="18"/>
							</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
  
</ResourceDictionary>
